package com.infoland.afanmall.model.youXuan.adapter;

import android.content.Context;
import android.support.v4.app.FragmentActivity;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.infoland.afanmall.R;
import com.infoland.afanmall.base.activity.GlideApp;
import com.infoland.afanmall.base.util.CacheKit;
import com.infoland.afanmall.model.youXuan.entity.OptionEntity;

import org.raphets.roundimageview.RoundImageView;

import java.util.List;

public class OptionAdapter extends BaseQuickAdapter<MultiItemEntity, BaseViewHolder> {
    private int layoutPosition = 0;
    private Context context;
    private FragmentActivity activity;

    public OptionAdapter(int layoutResId, List data, Context context, FragmentActivity activity) {
        super(R.layout.item_option_item, data);
        this.context = context;
        this.activity = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, MultiItemEntity item) {
        OptionEntity optionEntity = (OptionEntity) item;
        RoundImageView roundImageView = helper.getView(R.id.option_img);
        GlideApp.with(CacheKit.APP_CONTEXT).
                load(optionEntity.getF_url()).into(roundImageView);
        helper.setText(R.id.option_text, optionEntity.getAd_name());

    }
}
